﻿<%@ Page Language="C#" AutoEventWireup="true"  MasterPageFile="~/Popup.Master"  CodeBehind="Popup_LabourCharge.aspx.cs"
    Inherits="VSM.Popup_LabourCharge" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript" src="/js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="/js/main.js"></script>
   

    <script type="text/javascript">
        function RefreshUpdatePanel() {

        };

        function disablePopup(sender, evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode;
            if (charCode == 13)
                return true;

            return false;
        }
    </script>
    
 <div>
  <link href="../../skin/skin.css" rel="stylesheet" type="text/css" />
    <asp:UpdatePanel ID="editItemUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">       
        <ContentTemplate>
            <span class="style1">Labour Charge</span><br />
            <table border="0" width="100%">
            <tr>
                <td class="style2">
                    <asp:Button ID="btn_Save" runat="server" BackColor="#1B7FC2" 
                        ForeColor="#FFFFFF" Height="30px" 
                        Text="Save" Width="90px" onclick="btn_Save_Click" />

                    <asp:Button ID="btn_Cancel" runat="server" BackColor="#1B7FC2" 
                        ForeColor="#FFFFFF" Height="30px" OnClientClick="return Main.cancelDialogClick()" 
                        Text="Close" Width="90px" />
                    <asp:Label ID="lb_Message" runat="server" Text="[]"></asp:Label>
                </td>
            </tr>
                <tr>
                    <td class="FormLineItem">
                                <asp:Button ID="btn_LabourAdd" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                    Height="30px" Text="Add Labour Charge" Width="130px" OnClick="btn_LabourAdd_Click" />
                                <asp:FileUpload ID="fu_ImportExcel" runat="server" Width="219px" />
                                <asp:Button ID="btn_ImportExcel" runat="server" BackColor="#1B7FC2" 
                                    ForeColor="#FFFFFF" Height="30px" onclick="btn_ImportExcel_Click" 
                                    Text="Import Excel" Width="150px" />
                            </td>
                </tr>
            </table>
            <table border="0" width="100%">
                <asp:GridView ID="gvLabour" CssClass="GridInner" runat="server" Width="100%" BorderColor="White"
                            BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                            HeaderStyle-Height="27px" CellSpacing="2" 
                            OnRowUpdating="UpdateItem" HeaderStyle-VerticalAlign="Middle" 
                            AllowPaging="True" 
                            onrowdatabound="gvLabour_RowDataBound">
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                            <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                            <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                            <Columns>
                                <asp:CommandField HeaderText="Action" ShowDeleteButton="True" ShowEditButton="False"
                                    Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    ItemStyle-Width="70px" />
                                <asp:TemplateField HeaderText="Action">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" TabIndex="-1" OnClick="lnkDelete_Click"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="#">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblNo" runat="server" Text='<%# Bind("RowNum") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="#">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblLabourID" runat="server" Text='<%# Bind("LabourID") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Position Code">
                                    <ItemStyle HorizontalAlign="Left" Width="100px" />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_PositionCode" runat="server" Text='<%# Bind("PositionCode") %>' Width="97%" AutoPostBack="true"   OnTextChanged='TextBox_Change'
                                            ></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="FRTID" Visible="False">
                                    <ItemStyle HorizontalAlign="Left" Width="100px"  />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true"/>
                                    <ItemTemplate>
                                        <asp:Label ID="txt_FRTID" runat="server" Text='<%# Bind("FRTID") %>' Width="97%"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                 <asp:TemplateField HeaderText="Description">
                                    <ItemStyle HorizontalAlign="Left" Width="180px"  />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true"/>
                                    <ItemTemplate>
                                        <asp:Label ID="txt_FRTName" runat="server" Text='<%# Bind("FRTName") %>' Width="97%"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Work">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Right" Width="70px" />
                                    <ItemTemplate>
                                         <asp:TextBox ID="txt_FRTWork" Style="text-align: right" runat="server" AutoPostBack="true" Text='<%# Bind("FRTWork") %>' Width="97%" OnTextChanged='txt_Qty_TextChange'></asp:TextBox>
                                       <%-- <asp:Label ID="txtQty" runat="server" Style="text-align: right" Width="97%" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("Quantity")) %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" />--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Quantity">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Right" Width="70px" />
                                    <ItemTemplate>
                                         <asp:TextBox ID="txt_SubQty" Style="text-align: right" runat="server" AutoPostBack="true" Text='<%# String.Format("{0:N}", Eval("Qty")) %>' Width="97%" OnTextChanged='txt_Qty_TextChange'></asp:TextBox>
                                       <%-- <asp:Label ID="txtQty" runat="server" Style="text-align: right" Width="97%" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("Quantity")) %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" />--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Hour">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Right" Width="70px" />
                                    <ItemTemplate>
                                         <asp:TextBox ID="txt_Qty" Style="text-align: right" runat="server" AutoPostBack="true" Text='<%#String.Format("{0:N}", Eval("Quantity")) %>' Width="97%"></asp:TextBox>
                                       <%-- <asp:Label ID="txtQty" runat="server" Style="text-align: right" Width="97%" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("Quantity")) %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" />--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                 <asp:TemplateField HeaderText="Hour Charge">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Right" Width="70px" />
                                    <ItemTemplate>
                                         <asp:TextBox ID="txt_HourCharge" Style="text-align: right" runat="server" AutoPostBack="true" Text='<%#String.Format("{0:N}",  Eval("HourCharge")) %>' Width="97%" OnTextChanged='txt_Qty_TextChange'></asp:TextBox>
                                       <%-- <asp:Label ID="txtQty" runat="server" Style="text-align: right" Width="97%" Text='<%# String.Format("{0,-15:#,##0.00}", Eval("Quantity")) %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" />--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Labour Charge">
                                    <ItemStyle HorizontalAlign="Right" Width="100px"/>
                                    <HeaderStyle VerticalAlign="Middle"  />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_LabourCharge" Style="text-align: right" runat="server" Width="97%"  Text='<%# String.Format("{0:N}",  Eval("LabourCharge")) %>'
                                             OnKeyPress="return isNumberKey(this, event);" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Actual Hour">
                                    <ItemStyle HorizontalAlign="Right" Width="70px"/>
                                    <HeaderStyle VerticalAlign="Middle"  />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_ActualHour" Style="text-align: right" runat="server" Width="97%"  Text='<%#String.Format("{0:N}", Eval("ActualHour")) %>'
                                            AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                 <asp:TemplateField HeaderText="Technician">
                                    <ItemStyle HorizontalAlign="Right" Width="70px"/>
                                    <HeaderStyle VerticalAlign="Middle"  />
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_Technician" runat="server" Width="97%"  />
                                        <asp:HiddenField ID="hf_TechID" runat="server" Value='<%# Bind("TechCode") %>' />
                                    </ItemTemplate>

                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                                Height="27px" VerticalAlign="Bottom" />
                        </asp:GridView>        
            </table>
            <table border = "0", width="100%">
            
            <tr>
            <td>
                
            </td>
            </tr>
            </table>
            
        </ContentTemplate>

    </asp:UpdatePanel>
        </div>
</asp:Content>

